﻿(function ($) {
    bensie = jQuery;
    var api = {
        show: function (options) {
            var defaults = {
                id: 'bensie-popup-box',
                width: 300,
                caption: '系统消息',
                message: '正在处理，请稍候……',
                icon: '',
                showShade: 1,
                refresh: false,
                redirectUrl: '',
                callback: function () { }
            };
            var ps = $.extend(defaults, options);
            $('<div class="bensie_popup_shade" style="width:100%; height:100%; display:block" ></div>').appendTo($(document.body));
            $('#' + ps.id).css({ 'position': 'absolute', 'z-index': 1000, top: '100px' }).show();
        },
        close: function () {
            $('.bensie_popup_shade').remove();
            $('.bensie-popup-box').hide();
        }
    };
    bensie.popup = {
        show: api.show,
        close: api.close
    }
})($);